<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <title>workbench</title>
	<link rel="stylesheet" href="themes/main.css" type="text/css" />
</head>
<body>
<div id="header">
<div id="header-inner">
				<table cellpadding="0" cellspacing="0" style="width:100%;">
					<tr>
						<td rowspan="2" style="width:20px;">
						</td>
						<td style="height:52px;">
							<div style="color:#fff;font-size:22px;font-weight:bold;">
								<a href="/index.php" style="color:#fff;font-size:22px;font-weight:bold;text-decoration:none">OA</a>
							</div>
							<div style="color:#fff">
								<a href="/index.php" style="color:#fff;text-decoration:none">更快!更好!更强</a>
							</div>
						</td>
						<td style="padding-right:5px;text-align:right;vertical-align:bottom;">
							<div id="topmenu">
								<a href="/">首页</a>
							</div>
						</td>
					</tr>
				</table>
			</div>
			
</div>
<div id="mainwrap">
<div id="content">
    <link rel="stylesheet" type="text/css" href="easyui/themes/gray/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="easyui/demo.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
<div id="component" style="display:false;padding:20px;overflow:hidden;">
<h2>单位注册</h2>
    <div style="margin:10px 10px;" id="registerForm">
	        <form id="fm" method="post" novalidate>
	        <div class="fitem">
	        	<h2>单位信息</h2>
            </div>
            <div class="fitem">
                <label>单位名称:</label>
                <input name="company_name" required="true">
            </div>
            <div class="fitem">
                <label>省份:</label>
                <input name="province" required="true">
                <label>城市:</label>
                <input name="city" required="true">
                <label>区/县:</label>
                <input name="distinguish"  required="true">
            </div>
            <div class="fitem">
                <label>详细地址:</label>
                <input name="detailAddress" size="50" required="true">
            </div>
            <div class="fitem">
                <label>联系电话</label>
                <input name="company_phone" required="true">
            </div>
           	<div class="fitem">
	        	<h2>账号管理员信息</h2>
            </div>
            <div class="fitem">
                <label>用户名:</label>
                <input name="admin_name" required="true">
            </div>
            <div class="fitem">
                <label>姓名:</label>
                <input name="admin_display" required="true">
            </div>
            <div class="fitem">
                <label>密码:</label>
                <input name="admin_password" type="password" required="true">
            </div>
            <div class="fitem">
                <label>联系电话:</label>
                <input name="admin_phone" required="true">
            </div>
            <div class="fitem">
                <label>email:</label>
                <input name="admin_email" required="true" validType="email">
            </div>
        </form>

    <div style="margin:10px 10px;" id="dlg-buttons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="save()">Save</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">Cancel</a>
    </div>
	</div>
    <script type="text/javascript">
    $(function(){
    	$('#component').panel();
		$('#registerForm').panel();
	});
    	
    function save(){
        $('#fm').form('submit',{
            url: "company/register",
            onSubmit: function(){
                return $(this).form('validate');
            },
            success: function(result){
                var result = eval('('+result+')');
                if (result.result == "failed"){
                    $.messager.show({
                        title: 'Error',
                        msg: result.error
                    });
                } else {
                	$('#fm').form('clear'); 
                    $.messager.show({
                        title: 'Success',
                        msg: result.payload
                    });
                }
            }
        });
    }
    </script>
    <style type="text/css">
        #fm{
            margin:0;
            padding:10px 30px;
        }
        .ftitle{
            font-size:14px;
            font-weight:bold;
            padding:5px 0;
            margin-bottom:10px;
            border-bottom:1px solid #ccc;
        }
        .fitem{
            margin-bottom:5px;
        }
        .fitem label{
            display:inline-block;
            width:80px;
        }
    </style>
</div>

</div>
</div>
</body>
</html>
